package com.qf.dao;

import com.qf.entity.Branch;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.mapping.FetchType;

import java.util.List;

/**
 * @ClassName BranchDao
 * @Description TODO
 * @Author 86181
 * @Date 2022/8/28 17:48
 * @Version 1.0
 **/


public interface BranchDao {
    @Results(id = "branchMap",value = {
            @Result(column = "bid",property = "bid"),
            @Result(column = "bname",property = "bname"),
            @Result(column = "updatetime",property = "updatetime"),
            @Result(column = "pid",property = "pid"),
            @Result(column = "bid",property = "taskPlans",
                    many = @Many(select = "com.qf.dao.TaskPlanDao.findTaskPlansByBid",
                    fetchType = FetchType.EAGER))

    })
    @Select("select * from branch where status=1")
    List<Branch> findBranchs();
}
